/******************************************************************************/
/*                                                                            */
/*  Copyright (c) 2009: ngi-central.org                                       */
/*  All rights reserved.                                                      */
/*                                                                            */
/******************************************************************************/


#include <boost/test/unit_test.hpp>

#include "..\..\include\sgl\box.h"
#include "..\..\include\sgl\hyper_sphere.h"
#include "..\..\include\sgl\hyper_ellipsoid.h"
#include "..\..\include\sgl\area.h"
#define _USE_MATH_DEFINES
#include <math.h>

BOOST_AUTO_TEST_SUITE( area2d )


BOOST_AUTO_TEST_CASE( area__box2d )
{
	sgl::box<2> a;

	BOOST_CHECK( area(a) == 0 );

	sgl::box<2> b(
		sgl::point<2>(1, 2),
		sgl::vector<2>(3, 4));

	BOOST_CHECK( area(b) == 12 );
}

BOOST_AUTO_TEST_CASE( area__circle2d )
{
	sgl::circle2 a;

	BOOST_CHECK( area(a) == 0 );

	sgl::circle2 b(sgl::point<2>(1, 2), 3);

	BOOST_CHECK( area(b) == 3*3*M_PI );
}

BOOST_AUTO_TEST_CASE( area__ellipse2d )
{
	sgl::ellipse2 a;

	BOOST_CHECK( area(a) == 0 );

	sgl::ellipse2 b(sgl::point<2>(1, 2), sgl::vector<2>(3, 4));

	BOOST_CHECK( area(b) == 3*4*M_PI );
}


BOOST_AUTO_TEST_SUITE_END()

